-- GENERATED SPELL FOR [Infinite Defiler] --


function spell0_18171(pUnit, Event) --@Bane of Infinity,n/a--
pUnit:FullCastSpellOnTarget(38387,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18171', 590, 1)
end

function spell1_18171(pUnit, Event) --@Corruption,n/a--
pUnit:FullCastSpellOnTarget(21068,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18171', 26000, 1)
end

function spell2_18171(pUnit, Event) --@Curse of Infinity,n/a--
pUnit:FullCastSpellOnTarget(31977,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18171', 569, 1)
end

function spell3_18171(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(15232,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18171', 3000, 1)
end

function spell4_18171(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(38386,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18171', 3000, 1)
end

function Sorts_18171(pUnit, Event)
local choix_sorts_18171 = math.random(0, 4)
if choix_sorts_18171 == 0 then
pUnit:RegisterEvent('spell0_18171', 1, 1)
end
if choix_sorts_18171 == 1 then
pUnit:RegisterEvent('spell1_18171', 1, 1)
end
if choix_sorts_18171 == 2 then
pUnit:RegisterEvent('spell2_18171', 1, 1)
end
if choix_sorts_18171 == 3 then
pUnit:RegisterEvent('spell3_18171', 1, 1)
end
if choix_sorts_18171 == 4 then
pUnit:RegisterEvent('spell4_18171', 1, 1)
end
end

function mob18171_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18171', math.random(1500, 3000), 1)
end

function mob18171_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18171_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18171_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18171, 1, 'mob18171_Action')
RegisterUnitEvent(18171, 2, 'mob18171_Leave')
RegisterUnitEvent(18171, 3, 'mob18171_Kill')
RegisterUnitEvent(18171, 4, 'mob18171_Die')
